﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DailyComics.Common.Utilities
{
  public static class DateHelper
  {
    public static string ConvertToUnderScoreSeperatedDate(DateTime date)
    {
      return ConvertToCharacterSeperatedDate(date, '_');
    }

    public static string ConvertToForwardSeperatedDate(DateTime date)
    {
      return ConvertToCharacterSeperatedDate(date, '/');
    }

    private static string ConvertToCharacterSeperatedDate(DateTime date, char chr)
    {
      return string.Format("{0}{3}{1}{3}{2}", 
        date.Year, 
        date.Month.ToString().PadLeft(2, '0'), 
        date.Day.ToString().PadLeft(2, '0'), 
        chr);
    }
  }
}
